package cn.ymcc.fegin;

import cn.ymcc.fallback.SearchClientFallBackFactory;
import cn.ymcc.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

//@FeignClient("SEARCH")   // 指定服务名称
@FeignClient(value = "SEARCH",fallbackFactory = SearchClientFallBackFactory.class)
public interface SearchClient {


    @RequestMapping(value = "/search",method = RequestMethod.GET)
    String test01();

    @RequestMapping(value ="/search/findById/{id}",method = RequestMethod.GET)
    User findById(@PathVariable(value = "id") Integer id);

    @RequestMapping(value = "/search/findAll",method = RequestMethod.POST)
    User findAll(@RequestBody User user);

}
